/*
 * @Description: 
 * @version: 1.0
 * @Author: 赵卓轩
 * @Date: 2021-10-27 16:50:41
 * @LastEditors: 赵卓轩
 * @LastEditTime: 2021-10-27 17:39:16
 */
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
import React from 'react';
import { Breadcrumb } from 'antd';

// 更多配置请移步 https://github.com/icd2k3/react-router-breadcrumbs-hoc
const routes = [
    { path: '/', breadcrumb: '首页'},
    { path: '/animals', breadcrumb: '动物一览'},
    { path: '/animals/detail', breadcrumb: '动物详情'},
    { path: '/articles', breadcrumb: '帖子'},
    { path: '/articles/detail', breadcrumb: '帖子详情'},
    { path: '/articles/write', breadcrumb: '发帖' },
    { path: '/visibility', breadcrumb: '智能管理'},
    { path: '/visibility/camera', breadcrumb: '实时监控' },
    { path: '/chat', breadcrumb: '聊天'},
];

export default withBreadcrumbs(routes)(({ breadcrumbs }) => (
  <>
    {breadcrumbs.map(({ breadcrumb }) => <Breadcrumb.Item key={breadcrumb}>{breadcrumb}</Breadcrumb.Item>)}
  </>
));

